Skip to main content

sc.color

The Color Module for the computer API!


Functions

newSingluar

sc.color.newSingluar( rgbNum )

Creates a new color from 1 value. Whatever rgbNum's value has will be set on R, G, and B.

This means it's grayscale only!

Arguments:

  • rgbNum [ number ] The color value that will be set on R, G, and B.

Returns:

  • [ Color ] The generated color.

random

sc.color.random( from, to )

Generates a random color from whatever range you want.

Arguments:

  • from [ number ] The starting range.
  • to [ number ] The ending range.

Returns:

  • [ Color ] The generated color.

random0to1

sc.color.random0to1()

Generates a random color from 0 to 1.

Returns:

  • [ Color ] The generated color.

generateGradient

sc.color.generateGradient( colors, numColors )

This generates an interpolated gradient between the colors provided and is dependent on the ammount of gradient specified.

Arguments:

  • colors [ Color[] ] The table of colors to generate the gradient from.
  • numColors [ integer ] The ammount of blending each color gets in the gradient table.

Returns:

  • [ Color[] ] The generated gradient table.